﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DEsbInterface;
using System.ServiceModel;
using System.Transactions;

namespace DEsbServices
{
    [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
    public class AdminServiceImpl2:IAdmin
    {
        //[TransactionFlow(TransactionFlowOption.Allowed)]
        //[OperationBehavior(TransactionScopeRequired = true)]
        public bool CheckPermission(int userId)
        {
            //throw new Exception("fffffffffff");

            Console.WriteLine("CheckPermission222");
            if (Transaction.Current != null && Transaction.Current.TransactionInformation != null)
            {
                Console.WriteLine("           DistributedIdentifier: " + Transaction.Current.TransactionInformation.DistributedIdentifier);
                Console.WriteLine("           LocalIdentifier: " + Transaction.Current.TransactionInformation.LocalIdentifier);
            }
            else
            {
                Console.WriteLine("           No Transaction");
            }
            return userId%2==0;
        }


        public void WillOutofMemory()
        {
            StringBuilder sb = new StringBuilder(Int32.MaxValue);
        }
    }
}
